﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Routing.Constraints;
using System.Web.Routing;

namespace UrlsAndRoutes
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapMvcAttributeRoutes();
            //var route = new Route ("{controller}/{action}",new RouteValueDictionary () { {"action","Index"} },new MvcRouteHandler());
            //routes.Add("Default",route);
            routes.MapRoute("Default", "{controller}/{action}/{customerid}/{*catchall}", new {controller="Home",action = "Index",customerid=UrlParameter.Optional},
                new {controller="^H.*",action="^index$|^about$",httpMethod=new HttpMethodConstraint("Get"),customerid=new RangeRouteConstraint(1,50)}
            ,new[] { "UrlsAndRoutes.AdditionalControllers" });
          

        }
    }
}
